package com.czkt.service.Impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.czkt.mapper.CartMapper;
import com.czkt.pojo.Cart;
import com.czkt.service.CartService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CartServiceImpl extends ServiceImpl<CartMapper,Cart> implements CartService {

    @Override
    public List<Cart> cartList(Integer uid) {
        return baseMapper.cartList(uid);
    }

    @Override
    public int updateCart(Integer numbers, Integer cartId) {
        System.out.println("标识Id："+cartId);
        if (cartId!=null && cartId !=0 ){
            System.out.println("标识Id-----if："+cartId);
            return baseMapper.updateCart(numbers, cartId);
        }else {
            return 0;
        }
    }
}
